An Efficient Algorithm to Calculate the Center of the Biggest Inscribed Circle in an Irregular Polygon
نویسنده
چکیده
In this paper, an efficient algorithm to find the center of the biggest circle inscribed in a given polygon is described. This work was inspired by the publication of Daniel Garcia-Castellanos & Umberto Lombardo and their algorithm [1] used to find a landmass’ poles of inaccessibility. Two more efficient algorithms were found, one of them only applicable when the problem can be described as a linear problem, like in the case of a convex polygon. Introduction Given a polygon of N sides, how can we find the biggest inscribed circle? In other words, what is the furthest point from any vertex or edge? If the polygon has 3 sides, which would make it a triangle, this point is equivalent to the incircle and could be found by intersecting the bisection of any two of its angles. Likewise, if the polygon is a square, a pentagon, or any other regular shape, the same method works as illustrated in Figure 1. However, when that method is applied to an irregular polygon with more than 3 sides it might fail as shown in Figure 2. Figure 1. Center of the biggest inscribed circle in regular polygons using the intersection of any two bisections of the polygon’s angles. Figure 2. Intersection of two bisections does not necessarily yield the center of the biggest inscribed circle inside of an irregular polygon. When facing the problem with an irregular polygon, the solution can be found by taking the same approach used for the Poles of Inaccessibility (PIA) problem. A PIA is the most difficult point to reach within a landmass, commonly described as the point furthest from any coastline. If we look at a landmass as a polygon, the PIA of such landmass is identical to the center of the biggest circle inscribed in it. Summarizing the known algorithm’s methodology, to find the PIA we first describe a region R around a initial candidate for the PIA, then divide R into n by m cells and find the node (intersection between lines) furthest from any coastline to make it our next candidate PIA. Subsequently, R is centered around the new candidate PIA and shrunk by a factor of k, finding a new candidate and repeating the process until the desired precision is achieved. Figure 3 shows a visual demonstration of the methodology; for a detailed description of how the sequential algorithm used to find the PIA works refer to the original paper by Daniel Garcia-Castellanos & Umberto Lombardo. Figure 3. Visual demonstration of the sequential algorithm to find the PIA. Each point represents a node that has been compared against the candidate PIA in its iteration and the algorithm is recursively called until the density of nodes corresponds to the desired precision to be achieved. Monte Carlo’s approach The first proposed methodology is very similar to the known algorithm used to find the PIA. The key difference is in the choice of nodes, which would be done by the use of pseudo-randomly chosen coordinates within the region R, rather than sequentially by intersecting n and m lines. By choosing the nodes pseudo-randomly, the an iteration of the algorithm may finish at any arbitrary point rather than having to test n × m nodes in each of the regions. For this implementation, the region is shrunk when a new candidate PIA has not been found within the last k attempts. In Figure 4 we can visualize how the algorithm works and in Figure 5 the pseudo-code describing the algorithm is presented. Figure 4. Visual demonstration of the randomized algorithm to find the PIA. Each point represents a node that has been compared against the candidate PIA in its iteration and the algorithm is recursively called until the density of nodes corresponds to the desired precision to be achieved. while accuracy > minimum_accuracy do: # begin loop through nodes while consecutive_misses < k do: # select coordinates at random within bounds x := random(min_x, max_x) y := random(min_y, max_y) node := (x, y) # loop through edges and find shortest distance for edge := first_edge to last_edge do: if distance(node, edge) < smallest_distance smallest_distance := distance(node, edge) PIA := node end if end do # maximize the minimum distance through iterations # and keep track of the consecutive number of times # that a smallest distance has not been found if smallest_distance > maximin_distance maximin_distance := smallest_distance consecutive_misses := 0 else consecutive_misses := consecutive_misses + 1 end if end do # calculate current level of accuracy based on the # smallest distance between the upper and lower bound accuracy := min(max_x min_x, max_y min_y) # update the bounds of the region min_x := PIA(x) (max_x min_x) / (sqrt(2) * 2) max_x := PIA(x) + (max_x min_x) / (sqrt(2) * 2) min_y := PIA(y) (max_y min_y) / (sqrt(2) * 2) max_y := PIA(y) + (max_y min_y) / (sqrt(2) * 2)
منابع مشابه
Algorithm for finding the largest inscribed rectangle in polygon
In many industrial and non-industrial applications, it is necessary to identify the largest inscribed rectangle in a certain shape. The problem is studied for convex and non-convex polygons. Another criterion is the direction of the rectangle: axis aligned or general. In this paper a heuristic algorithm is presented for finding the largest axis aligned inscribed rectangle in a general polygon. ...
متن کاملAn application of geometrical isometries in non-planar molecules
In this paper we introduce a novel methodology to transmit the origin to the center of a polygon in a molecule structure such that the special axis be perpendicular to the plane containing the polygon. The mathematical calculation are described completely and the algorithm will be showed as a computer program.
متن کاملA Fast Algorithm for Covering Rectangular Orthogonal Polygons with a Minimum Number of r-Stars
Introduction This paper presents an algorithm for covering orthogonal polygons with minimal number of guards. This idea examines the minimum number of guards for orthogonal simple polygons (without holes) for all scenarios and can also find a rectangular area for each guards. We consider the problem of covering orthogonal polygons with a minimum number of r-stars. In each orthogonal polygon P,...
متن کاملBertrand’s Paradox Revisited: More Lessons about that Ambiguous Word, Random
The Bertrand paradox question is: “Consider a unit-radius circle for which the length of a side of an inscribed equilateral triangle equals 3 . Determine the probability that the length of a ‘random’ chord of a unit-radius circle has length greater than 3 .” Bertrand derived three different ‘correct’ answers, the correctness depending on interpretation of the word, random. Here we employ geomet...
متن کاملA Fast and Efficient On-Line Harmonics Elimination Pulse Width Modulation for Voltage Source Inverter Using Polynomials Curve Fittings
The paper proposes an algorithm to calculate the switching angles using harmonic elimination PWM (HEPWM) scheme for voltage source inverter. The algorithm is based on curve fittings of a certain polynomials functions. The resulting equations require only the addition and multiplication processes; therefore, it can be implemented efficiently on a microprocessor. An extensive angle error analysis...
متن کاملذخیره در منابع من
با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید
عنوان ژورنال:
- CoRR
دوره abs/1212.3193 شماره
صفحات -
تاریخ انتشار 2012